An advanced technology is available for preventing an accident, such as a vehicle-to-vehicle collision or a vehicle-to-person collision, by monitoring the surroundings of a vehicle with an on-board camera, outputting a warning to a driver of the vehicle upon detection of a dangerous condition, and automatically controlling the behavior of the vehicle as needed. In a system where an on-board camera is mounted on the outer surface of a vehicle, a lens of the on-board camera is likely to be dirtied by mud and dust that are whirled up due to rainy or other bad weather or traveling of the vehicle. A dirty lens may result in a false warning and become detrimental to safety. To avoid such a situation, a system for automatically detecting a dirty lens and removing dirt from the lens by spraying air or water onto it is put to practical use. However, such a system is generally expensive. It is preferred that vehicle detection be steadily achieved wherever possible even if the shape of the vehicle imaged with a considerably dirty lens is partially lost or blurred.
A technology disclosed, for example, in Patent Literature 1 compares mutually corresponding pixels in a plurality of images that are captured at different time points to show lens dirt of an on-board camera, determines that pixels having an inter-image density difference equal to or smaller than a threshold value are dirty, and notifies a user of a dirtied lens.